﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess;
using EntityDaoLibrary;

namespace BusinessRules
{
    public class OperatorRules
    {
        public OperatorRules()
        {
 
        }

        public int CheckOperator(string username,string pwd)
        {
            IDataAccess data = DataAccessFactory.instance.CreateDataAccess();
            data.Open();
            try
            {
                OperatorDAO dao = new  OperatorDAO(data);
                return dao.FindByOperatorID(username,pwd);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
            finally
            {
                data.Close();
            }
        }
    }
}
